<%= error_messages_for :candidat %>
<% form_for(@candidat, @user, :html =>{:multipart => true}) do |f| %>
    <p>
      <%= f.label :nom %><br />
      <%= f.text_field :nom %>
    </p>
    <p>
      <%= f.label :prenom %><br />
      <%= f.text_field :prenom %>
    </p>
    <p>
      <%= f.label :photo, "Photo (jpg,png), redimensionné au carré" %><br />
      <%= f.file_field :photo, :accept => "image/png,image/jpeg" %>
    </p>
    <p>
      <%= f.label :parti, "Parti politique" %><br />
      <%= f.text_field :parti %>
    </p>
    <p>
      <%= f.label :naissance, "Date de naissance" %><br />
      <%= f.date_select :naissance, :start_year => 1912, :end_year => 1994 %>
    </p>
    <p>
      <%= f.label :qg, "QG" %><br />
      <%= f.text_field :qg %>
    </p>
    <p>
      <%= f.label :slogan %><br />
      <%= f.text_field :slogan %>
    </p>
    <p>
      <%= f.label :programme %><br />
      <%= f.text_area :programme %>
    </p>
    <p>
      <% unless edit %>
          <% f.fields_for :user_attributes, @user do |user_form| %>
              <%= render :partial => 'users/user', :locals => {:user_form => user_form} %>
          <% end %>
      <% end %>
    </p>
    <p>
      <%= f.submit button_name %>
    </p>
<% end %>